package com.danielepelagatti.flickrmanager.model
{
	import com.adobe.cairngorm.model.ModelLocator;
	import com.adobe.webapis.flickr.Photo;
	import com.danielepelagatti.flickrmanager.vo.UploadVO;
	import com.theriabook.utils.Logger;
	
	import flash.utils.Dictionary;
	
	import mx.collections.ArrayCollection;
	import mx.utils.ObjectProxy;
	/**
	 * 
	 * @author dpelagatti
	 * 
	 */	
	public class LocalUser implements ModelLocator
	{
		/**
		* 
		*/		
		protected static var inst:LocalUser;
        /**
         * 
         * @return 
         * 
         */		
        public static function getInstance():LocalUser
        {
            if(inst == null)
            {
                inst = new LocalUser();
            }
            return inst;
        }
        [Bindable]
		/**
		* 
		*/		
		public var user:ObjectProxy;
		[Bindable]
		/**
		* 
		*/		
		public var photoCollection:PhotoCollection = new PhotoCollection();	
		[Bindable]	
		/**
		* 
		*/		
		public var activeUploads:ArrayCollection = new ArrayCollection();
		[Bindable]
		/**
		* 
		*/		
		public var currentPage:int=0;
		[Bindable]
		/**
		* 
		*/		
		public var totalPages:int=0;
		/**
		 * 
		 * @param upload
		 * 
		 */		
		public function addUpload(upload:UploadVO):void
		{
			if(activeUploads.getItemIndex(upload) == -1)
			{
				activeUploads.addItemAt(upload,0);
			}
		}		
	}
}